package test;

//在lwl本地分支加了这句话
import java.util.ArrayList;
public class SchoolSystem implements ISignUp {
    Integer big,medium,small;
    ArrayList list = new ArrayList();
    public SchoolSystem(Integer big, Integer medium, Integer small){
        this.big = big;
        this.medium = medium;
        this.small = small;
        list.add(null);
    }
    @Override
    public  boolean addStudent(int stuType){
        if(big>0&&stuType==1){
            big--;
        }else if(medium>0&&stuType==2){
            medium--;
        }else if(small>0&&stuType==3){
            small--;
        }else{
            list.add(false);
            return false;
        }
        list.add(true);
        return true;
    }
    public void print() {
        for(int i=0;i< list.size();i++){
            System.out.print(list.get(i)+" ");
        }
    }

    public static void main(String[] args) throws Exception {
        SchoolSystem sc = new SchoolSystem(1,1,0);
        String str = "1,2,3,1";
        String []s = str.split(",");
        int []num = new int[s.length];
        for(int i=0;i<s.length;i++){
            num[i] = Integer.parseInt(s[i]);
        }
        for(int i=0;i<s.length;i++){
            sc.addStudent(num[i]);
        }
        sc.print();
    }
}